import apiConfig from "@/utils/apiConfig";
export default {
    data() {
        return {
        }
    },
    props:{
      path:{//工作台把路径传过来
        type:String,
        default:""
      }
    },
    mounted(){
    },
    created() {
    },
    computed:{
      activePage(){
        let _url = this.path?this.path:this.$route.fullPath
        let urls = _url.split("?")
        let path = urls[0].split("/")
        let key = path[path.length - 1]
        return key
      },
      fullPath(){
        if(this.path)return this.path
        let urls = this.$route.fullPath.split("?")
        return urls[0].replace("/", "")
      },
      api(){
        let _api = apiConfig[this.fullPath].api
        let computed = require(`@/api/${_api?_api:this.fullPath}/index`);
        return computed.default
      },
      listTablePath(){
        return apiConfig[this.fullPath].listTable
      },
      leftFormPath(){
        return apiConfig[this.fullPath].leftForm
      },
      interfaceUrl(){//打印导出 时需要用到
        return apiConfig[this.fullPath].interfaceUrl
      },
      workFlowKey(){
        return apiConfig[this.fullPath].workFlowKey
      },
      apiUrl(){
        return apiConfig[this.fullPath].api
      }
    },
    methods: {
        isThisPage(name) {
            return this.$route.fullPath.includes(name)
        }
    }
}
